<!DOCTYPE html>

<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>课程表</title>
    <!-- Bootstrap JQ核心CSS 、JS-->
    <script src="/static/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
    <link href="/static/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/static/linling-core-tools/js/linling-core-tools.js" type="text/javascript"></script>
    <!-- 适用于Surface /台式机Windows 8错误的IE10视口黑客 -->
    <script src="/static/linling-core-tools/js/ie10-viewport-bug-workaround.js" type="text/javascript"></script>
    <link href="/static/linling-core-tools/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <script type="text/javascript" th:text="'let id='+${courseInfo.getId()}"></script>
    <script type="text/javascript">
        let year;
        let term;
        // let id;

        /**
         * 刷新
         */
        function referTime() {
            year = $("#year").children('option:selected').val();
            term = $("#term").children('option:selected').val();
        }

        function load() {
            location.href = "/course/load";
        }

        function goto() {
            referTime();
            location.href = "/course/info/" + id + "?year=" + year + "&term=" + term;
        }
    </script>
</head>
<body>
<h1 class="page-header"
    th:text="${courseInfo.getName()}+'在'+${courseInfo.getYear()}+'年'+${courseInfo.getTerm()}+'月学期课表'">课程表</h1>
<span>切换：</span>
<label for="year" class="form-inline">
    <select class="bootstrap-select form-control" data-style="btn-info" id="year" name="year">
        <option value="2020" th:value="${courseInfo.getYear()}" th:text="'当前：'+${courseInfo.getYear()}">默认2020</option>
        <option value="2017">2017</option>
        <option value="2018">2018</option>
        <option value="2019">2019</option>
        <option value="2020">2020</option>
        <option value="2021">2021</option>
        <option value="2022">2022</option>
        <option value="2023">2023</option>
        <option value="2024">2024</option>
        <option value="2025">2025</option>
        <option value="2026">2026</option>
    </select>
</label>
<label for="term" class="form-inline">
    <select class="bootstrap-select form-control" data-style="btn-info" id="term" name="term">
        <option value="12" th:value="${courseInfo.getTerm()}" th:text="'当前：'+${courseInfo.getTerm()}">默认下学期</option>
        <option value="3">上学期（3月）</option>
        <option value="12">下学期（12月）</option>
    </select>
</label>
<button id="search" class="btn btn-primary" onclick="goto()">
    <span class="glyphicon glyphicon-refresh"></span> 切换
</button>&nbsp;
<button class="btn btn-success" onclick="load()">
    <span class="glyphicon glyphicon-plus"></span> 添加课表
</button>&nbsp;
<p></p>
<div class="table-responsive">
    <table id="listCustomer" class="table table-striped table-bordered">
        <thead>
        <tr>
            <th>项目</th>
            <th>周一</th>
            <th>周二</th>
            <th>周三</th>
            <th>周四</th>
            <th>周五</th>
            <th>周六</th>
            <th>周日</th>
        </tr>
        </thead>
        <tbody id="searchVar">
        <!-- 预留数据 -->
        <tr th:each="list:${courseInfo.getObj()}">
            <td th:each="info:${list}">
                <div th:utext="${info}"></div>
            </td>
        </tr>
        </tbody>
        <tfoot>
        <!-- 尾部数据 -->
        <tr></tr>
        </tfoot>
    </table>
</div>
</body>
</html>